import QtQuick

Item {
    id: blingBtn
    width: 200
    height: 80

    signal btnClicked
    property string btnText: "BlingBtn"

    Rectangle{
        id: rec
        anchors.fill: parent
        radius: parent.height / 2
        color: "#57b9fc"
        border.color: "#2e2f30"

        MouseArea{
            anchors.fill: parent
            onClicked: {
                blingBtn.btnClicked()
                colorAnimation.start()
            }
        }

        Text{
            id: label
            anchors.centerIn: parent
            text: blingBtn.btnText
        }

        ColorAnimation {
            id: colorAnimation
            target: rec
            property: "color"
            duration: 300
            to: "#89bbdf"
            from: "#57b9fc"
        }
    }
}
